import ctypes
import os
from ctypes import c_int, c_longlong

# DLL 的路径
DLL_PATH = os.path.join(os.path.dirname(__file__), "dll", "demo.dll")
dll = ctypes.CDLL(DLL_PATH)

# int add(int a, int b);
dll.add.argtypes = (c_int, c_int)
dll.add.restype = c_int


def add_cpp(a: int, b: int) -> int:
    return dll.add(a, b)


# long long fibonacci(int n);
dll.fibonacci.argtypes = (c_int,)
dll.fibonacci.restype = c_longlong


def fibonacci_cpp(n: int) -> int:
    return dll.fibonacci(n)
